﻿using System;
using System.Collections.Generic;

using Microsoft.VisualStudio.TemplateWizard;

namespace Wizard
{
    public class RootWizard : IWizard
    {
        public static string SolutionName;

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            if (string.IsNullOrEmpty(SolutionName))
            {
                SolutionName = replacementsDictionary["$safeprojectname$"];

                replacementsDictionary.Add("$SolutionName$", SolutionName);
            }
        }

        public void BeforeOpeningFile(EnvDTE.ProjectItem projectItem)
        {
        }

        public void ProjectFinishedGenerating(EnvDTE.Project project)
        {
        }

        public void ProjectItemFinishedGenerating(EnvDTE.ProjectItem projectItem)
        {
        }

        public void RunFinished()
        {
            SolutionName = string.Empty;
        }

        public bool ShouldAddProjectItem(string filePath)
        {
            return true;
        }
    }
}
